<?php
require_once("../inc/bootstrap.php");

/* Send an upload to another node.
   Parameter: id=post ID
   Return value: a file.
*/

	if (!empty($_GET['id']))
	{
		$ID = intval($_GET['id']);
		header('Content-Description: File Transfer');
		header('Content-Type: application/octet-stream');
		header('Content-Disposition: attachment; filename='.$ID);
		header('Content-Transfer-Encoding: binary');
		header('Content-Length: '.filesize($uploadsDir.$ID));
		flush();
		ob_flush();
		readfile($uploadsDir.$ID);
		exit;
	}

?>